<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<div contenteditable id="root" class="editing">
<span id="sample">foo   bar    baz</span>
</div>
<div id="log"></div>
<script>
test(function() {
    var selection = window.getSelection();
    var sample = document.getElementById('sample');
    selection.collapse(sample, 0);
    for (i = 0; i < 11; ++i)
        selection.modify('move', 'forward', 'character');
    assert_true(selection.isCollapsed, 'isCollapsed');
    assert_equals(selection.anchorNode, sample.firstChild, 'anchorNode');
    assert_equals(selection.anchorOffset, 16, 'anchorOffset');
});
</script>
